package com.hphs.controller;

import com.hphs.model.CargoodQuery;
import com.hphs.model.Cargoods;
import com.hphs.model.Videos;
import com.hphs.model.VideosQuery;
import com.hphs.service.CarGoodsService;
import com.hphs.service.VideoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/goods")
//@CrossOrigin  // 跨域访问
public class CarGoodsController {

//    @GetMapping
//    public String Hello(){
//        return "hello 123";
//    }
    @Autowired
    private CarGoodsService service;


    @GetMapping
    public List<Cargoods> select(CargoodQuery query){
        List<Cargoods> cargoodsList = service.select(query);
        return cargoodsList;
    }
//    @GetMapping
//    public ResponseDTO select(VideosQuery query){
//        List<Videos> videosList = service.select(query);
//        return ResponseDTO.success(videosList);
//    }
}
